package com.yfeng.common.action;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.yfeng.common.utils.BeanUtil;
import com.yfeng.goodjuhome.model.User;


/**
 * 一些基本的action
 */
@Controller
public class BaseAction {
	private static final Log log = LogFactory.getLog(BaseAction.class);
	/*
	 * 导航到登陆页面
	 */
	@RequestMapping("/index")
	public String index(ModelMap model) {
		try {	
			return "/login";
		} catch (Exception e) {
			log.error(e.getMessage(), e);
		}
		return "";
	}
	
	/*
	 * 导航到主框架页面
	 */
	@RequestMapping("/mainframePage")
	public String mainframepage() {
		return "/mainframe";
	}
	

	@RequestMapping("/admin/mainframePage")
	public String toAdminMainframePage(){
		return "/admin/mainframe";
		
	}
	
	
	/*
	 * 导航到主框架页面
	 */
	@RequestMapping("/admin/mainframe")
	public String mainframe() {
		return "/mainframe";
	}
	

	/*
	 * 导航到错误页面
	 */
	@RequestMapping("/error")
	public String toErrorPage(String message,String url,ModelMap model) {
		model.put("message", message);
		model.put("url", url);
		return "/error";
	}
	@RequestMapping("/404")
	public String notFoundPage() {
		return "/404";
	}

	@RequestMapping("/403")
	public String accessDeniedPage() {
		return "/403";
	}

	@RequestMapping("/500")
	public String errorDeniedPage() {
		return "/500";
	}

}
